package mylibrary.io;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.InputStream;

public class Test {

	public static void main(String[] args) throws Exception {
		
		InputStream ir = new FileInputStream("c:/orange.txt");
		ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
		
		byte[] temp = new byte[1024];
		
		int size=0;

		while ((size=ir.read(temp, 0, temp.length)) != -1) {
			System.out.println(size);
			out.write(temp, 0, temp.length);
		}
		
		//byte[] content = out.toByteArray();
		
//		for(byte b:content) {
//			System.out.println(b);
//		}
		System.out.println(out.toString());
		
		//System.out.println(content.length);
		
		System.out.println(Integer.toBinaryString(-56));
		
		
//		int a = 0x80010000;
//		char c = '汉';
//		System.out.println((int)c);
	}
}
